package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(50)" json:"username"`
	Password string `gorm:"type:varchar(50)" json:"password"`
}

type Master struct {
	gorm.Model
	Title           string `gorm:"type:varchar(50)" json:"title"`
	Content         string `gorm:"type:varchar(50)" json:"content"`
	Img             string `gorm:"type:varchar(255)" json:"img"`
	Node            string `gorm:"type:varchar(50)" json:"node"`
	CollectionCount int    `gorm:"type:int" json:"collection_count"`
}

type Collection struct {
	gorm.Model
	UserID   uint   `gorm:"type:int" json:"user_id"`
	User     User   `gorm:"foreignKey:UserID" json:"user"`
	MasterID uint   `gorm:"type:int" json:"master_id"`
	Master   Master `gorm:"foreignKey:MasterID" json:"master"`
}
